Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Printing Extensions and Drivers /
Chapter 5 - Printing Functions for Message Overrides / Printing Functions Reference
Functions / Printing Control Functions


GXHandleChooserMessage

You can use the GXHandleChooserMessage function to respond when a user selects a Chooser item for your printer driver.

OSErr GXHandleChooserMessage (gxJob *aJob, Str31 driverName,
                           short message, short caller,
                           StringPtr objName, StringPtr zoneName,
                           ListHandle theList, long p2);
aJob
A reference to a job object.
driverName
The name of the printer driver; for example, "LaserWriter."
message
The operation that is to be performed.
caller
The caller. A value of 1 indicates the Chooser. Values in the range 0 to 127 are reserved; values outside of this range can be used by applications.
objName
A pointer to other information. The value of this parameter depends on the value of the message parameter.
zoneName
The name of the AppleTalk zone containing the devices in the device list.
theList
A handle to the List Manager list that contains the device choices that are displayed in the device list box.
p2
Other information. The meaning of this parameter depends on the value of the message parameter.
function result
An error code. The value noErr indicates that the operation was successful.
DESCRIPTION
When the user interacts with your driver in the Chooser, the Chooser sends messages to your driver. What the Chooser sends depends on information in the package ('PACK') resource that you have defined for your driver. The GXHandleChooserMessage function makes it possible for your driver to work with the Chooser without you having to write the package-handling code.

When the Chooser sends a message to your driver, you can call this function to allow QuickDraw GX to handle the Chooser actions for you. You can perform your own actions, depending on which message has been sent, and then pass the information that the Chooser sent to you along to this function, which takes care of the rest for you.

The messages that the Chooser can send to your driver are shown in Table 5-1.
Table 5-1 Messages that the Chooser sends to drivers
MessageValueExplanation
init11The Chooser sends this message to your package when the user selects the icon representing your package in the icon list.
newSel12If your device package allows multiple selections, the Chooser sends this message to your packages when the user changes or adds a selection.
fillList13The Chooser sends this message when the user selects a device icon.
getSel14The Chooser sends this message to determine which entries should be selected. The Chooser does not send this message for serial printers.
select15If your device package does not allow multiple selections, the Chooser sends this message to your packages when the user selects a device from the device list.
deselect16If your device package does not allow multiple selections, the Chooser sends this message to your packages when the user deselects a device in the device list.
terminate17The Chooser sends this message when the user selects a different device icon, closes the Chooser window, or changes zones.
button18The Chooser sends this message when the user clicks one of the buttons in the Chooser window.

RESULT CODES
gxSegmentLoadFailedErrA required code segment could not be found,
or there was not enough memory to load it.
gxPrUserAbortErrThe user has canceled printing.
SEE ALSO
An example of using the GXHandleChooserMessage function is shown in Listing 5-3 on page 5-9.

Inside Macintosh: Devices describes the Chooser messages and package resources in detail.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help